/**
 * 
 */
package br.com.estrategos.modelo.menu;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

import org.hibernate.annotations.ForeignKey;

/**
 * @author x12259401
 *
 */
@MappedSuperclass
public abstract class SubMenu {

	@Id
	@Column(name = "idsubmenu", unique = true)
	@GeneratedValue
	private Long idSubMenu;
	
	@Column(name="descricao", length=25, nullable=false)
	private String descricao;	
	
	@Column(nullable=false)
	private boolean status;
	
	@Column(nullable=false)
	private Date dtcadastro;
	
	@ManyToOne(targetEntity = MenuEntity.class, fetch = FetchType.LAZY)
	@ForeignKey(name="fk_idmenu_sb")
	private MenuEntity menu;

	public Long getIdSubMenu() {
		return idSubMenu;
	}

	public void setIdSubMenu(Long idSubMenu) {
		this.idSubMenu = idSubMenu;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public boolean isStatus() {
		return status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	public Date getDtcadastro() {
		return dtcadastro;
	}

	public void setDtcadastro(Date dtcadastro) {
		this.dtcadastro = dtcadastro;
	}

	public MenuEntity getMenu() {
		return menu;
	}

	public void setMenu(MenuEntity menu) {
		this.menu = menu;
	}
	
	
}
